<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            height: 100vh;
        }

        div {
            height: 100%;
        }

        div img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
    </style>
</head>

<body>
    <div></div>
</body>
<script src="./js/index.js"></script>
<script>
    let ttt = () => {
        let index = async () => {
            let se = await http.get({
                url: "http://127.0.0.1:3000/api/json/info",
                data: {
                    id: query("id"),
                    quantity: query("total")
                }
            })
            console.log(se)

            let dd=0
            setInterval(() => {
                if(dd<se.result.length){
                    $("div").innerHTML += `
                      <img src="${se.result[dd]}" alt="">`
                      dd+=1
                }
            }, 2000)



        }

        index()
    }

    ttt();
    function query(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null)
            return unescape(r[2]);
        return null;
    }

    function $(className) {
        return document.querySelector(className);
    }
</script>

</html>